package user;

import book.BookList;
import operation.*;

import java.util.Scanner;

//管理员
public class Root extends Person {

    private static String rootmima;


    static {
        rootmima = "050612";
    }
    public Root(String name) {
        super(name);
        iOperation = new IOperation[]{new exit(),new find(),new add(),new del(),new show()};
    }

    public static String getRootmima() {
        return rootmima;
    }

    @Override
    public int menu() {
        System.out.println("**************************************************");
        System.out.println("*********        图书管理系统—管理员菜单    **********");
        System.out.println("*********    1.查找图书      2.新增图书    **********");
        System.out.println("*********    3.删除图书      4.显示图书    **********");
        System.out.println("*********    0.退出系统                   *********");
        System.out.println("**************************************************");
        Scanner scanner = new Scanner(System.in);
        System.out.print("请选择你的操作：");
        int choise = scanner.nextInt();
        return choise;
    }

    @Override
    public void caouo(int choise, BookList booklist) {
        iOperation[choise].work(booklist);
    }

    @Override
    public void huanying() {
        System.out.println("你好，管理员 "+name+" !!!");
    }
}